<% for (var i in arr) {%>

 <% var userName = arr[i].folder_name %>
 <% var type = arr[i].folder %>
 <li class='email_menu email_<%=userName%>' name = '<%=userName%>' type = '<%=type%>'>
     <span class='email_img menu_<%=userName%>'> </span>
     <span class='email_text'><%=userName%></span>
     <span class='email_icon'></span>
     <% if (userName == 'Drafts' && parseInt(arr[i].msgs_all) > 0) {%>
        <span class='email_num'><%=arr[i].msgs_all%></span>
     <% } else if (userName =='Sent') {%>

     <% } else if (parseInt(arr[i].msgs_new)> 0) { %>
        <span class='email_num'><%=arr[i].msgs_new%></span>
     <% } %>
 </li>
 <% if (userName == 'Saved' && i < arr.length-1) {%>
    <p> My Folders</p>
 <% } %>
<% } %>
